package no.evalanche.logic;

public class MC_Result {

	private int totalNumberOfChallenges;
	private int numberOfdisplayedChallenges;
	private int countanswered;
	private int countcorrect;

	public MC_Result(int t) {
		reset(t);
	}

	private void reset(int t) {
		totalNumberOfChallenges = t;
		countanswered = 0;
		countcorrect = 0;
		numberOfdisplayedChallenges = 0;
	}
	
	public int getNumberOfdisplayedChallenges() {
		return numberOfdisplayedChallenges;
	}

	public String getNumberOfChallenges() {
		return ""+totalNumberOfChallenges;
	}

	public void setTotalNumberOfChallenges(int totalNumberOfChallenges) {
		this.totalNumberOfChallenges = totalNumberOfChallenges;
	}

	public String getCountanswered() {
		return ""+countanswered;
	}

	public void incCountanswered() {
		countanswered += 1;
	}

	public String getCountcorrect() {
		return ""+countcorrect;
	}

	public void incCountcorrect() {
		countcorrect += 1;
	}
	
	public int incNumberofDisplayedChallenges() {
		return (numberOfdisplayedChallenges++);
	}


	public boolean hasResults() {
		return numberOfdisplayedChallenges>0;
	}

	public boolean exhausted() {
		return numberOfdisplayedChallenges == totalNumberOfChallenges || totalNumberOfChallenges == 0;
	}

}
